﻿Public Class frmMain

    Private Sub btnCalc_Click(sender As System.Object, e As System.EventArgs) Handles btnCalc.Click
        Dim components_vector1 As Transact.Trigonometry.RectCoordinate = Transact.Trigonometry.PolarToRect(numericMagnitude.Value, numericAngle.Value, Transact.Trigonometry.AngleType.Degrees, False)
        Dim components_vector2 As Transact.Trigonometry.RectCoordinate = Transact.Trigonometry.PolarToRect(numericMagTwo.Value, numericAngleTwo.Value, Transact.Trigonometry.AngleType.Degrees, False)

        Dim XSum As Double = components_vector1.X + components_vector2.X
        Dim YSum As Double = components_vector1.Y + components_vector2.Y

        Dim resultant As Transact.Trigonometry.PolarCoordinate = Transact.Trigonometry.RectToPolar(XSum, YSum, Transact.Trigonometry.AngleType.Degrees, False)
        MsgBox("Magnitude: " & resultant.R & vbCrLf & "Angle: " & resultant.Theta, MsgBoxStyle.OkOnly, "Resultant Vector")
    End Sub
End Class
